<script setup>
const props = defineProps({
  list: {
    type: Array,
  },
  value: {
    type: Number
  }
});

const list = [{
  value: 0,
  label: '草稿',
  labelType: 'primary'
}, {
  value: 1,
  label: '审批中',
  labelType: 'primary'
}, {
  value: 2,
  label: '审批完成',
  labelType: 'primary'
},{
  value: 3,
  label: '驳回',
  labelType: 'danger'
},{
  value: 4,
  label: '已完成',
  labelType: 'info'
},{
  value: 5,
  label: '待处理',
  labelType: 'primary'
},{
  value: 6,
  label: '已处理',
  labelType: 'primary'
},{
  value: 7,
  label: '待盘点',
  labelType: 'success'
}, {
  value: 8,
  label: '盘点中',
  labelType: 'primary'
},{
  value: 9,
  label: '维修中',
  labelType: 'primary'
}]

const label = computed(()=> {
  const one = list.find(item=>item.value === props.value);
  if (!one) {
    return '未知';
  }
  return one.label;
})

const labelType = computed(()=> {
  const one = list.find(item=>item.value === props.value);
  if (!one) {
    return 'primary';
  }
  return one.labelType;
})

</script>

<template>
  <el-tag size="small" effect="plain" :type="labelType">
    {{label}}
  </el-tag>
</template>

<style scoped lang="scss">

</style>